package com.shuigu.ai.service;

import java.util.List;
import com.shuigu.ai.domain.App;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shuigu.ai.model.request.AppAddRequest;
import com.shuigu.ai.model.vo.AppVO;
import com.shuigu.common.core.domain.entity.SysUser;
import reactor.core.publisher.Flux;

/**
 * 应用Service接口
 *
 * @author shuigu
 * @date 2025-09-14
 */
public interface IAppService extends IService<App> {
    /**
     * 查询应用
     *
     * @param id 应用主键
     * @return 应用
     */
    public App selectAppById(Long id);
    /**
     * 查询应用列表
     *
     * @param app 应用
     * @return 应用集合
     */
    public List<App> selectAppList(App app);

    public List<AppVO> selectMyAppList(App app);

    public List<AppVO> selectGoodAppList(App app);
    /**
     * 新增应用
     *
     * @param app 应用
     * @return 结果
     */
    public int insertApp(App app);
    /**
     * 修改应用
     *
     * @param app 应用
     * @return 结果
     */
    public int updateApp(App app);
    /**
     * 批量删除应用
     *
     * @param ids 需要删除的应用主键集合
     * @return 结果
     */
    public int deleteAppByIds(Long[] ids);
    /**
     * 删除应用信息
     *
     * @param id 应用主键
     * @return 结果
     */
    public int deleteAppById(Long id);


    public Long createApp(AppAddRequest appAddRequest);

    public AppVO getAppVO(App app);

    public List<AppVO> getAppVOList(List<App> appList);

    Flux<String> chatToGenCode(Long appId, String message, SysUser loginUser, boolean agent);

    String deployApp(Long appId, SysUser loginUser);

    public void generateAppScreenshotAsync(Long appId, String appUrl);
}
